from .base import BaseProvider, ProviderUserInfo


class AAIProvider(BaseProvider):
    def get_user_info(self, token: dict) -> ProviderUserInfo:
        aai_client = self.get_oidc_client()
        user_info = aai_client.userinfo(token=token)
        return ProviderUserInfo(
            external_id=user_info['sub'],
            true_name=user_info['name'],
            org_name=user_info['orgName'],
            email=user_info['email']
        )
